﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GmFamilyService.h"
#include "IFamilyForm.h"

namespace gcmp
{
    enum class BooleanOperationTypes;
}

namespace gfam
{

    class IFamily2DSketchCurve;
    class IFamily2DSketchLine;
    class IFamilyGeneralForm;

    ///\brief 布尔体，由几何体布尔运算得到
    class GM_FAMILY_SERVICE_EXPORT IFamilyBoolForm : public IFamilyForm
    {
        DEFINE_CAST_DERIVED(gfam::IFamilyBoolForm, gfam::IFamilyForm)

    public:
        /// \brief 创建布尔体
        /// 
        /// \param pDocument 文档
        /// \param leftFormId 左几何体id
        /// \param rightFormId 右几何体id
        /// \param booleanOperationType 布尔操作类型
        /// \return 布尔体
        static IFamilyBoolForm* Create(
            gcmp::IDocument* pDocument,
            const gcmp::ElementId& leftFormId,
            const gcmp::ElementId& rightFormId,
            gcmp::BooleanOperationTypes booleanOperationType);

        /// \brief 获取布尔操作类型
        /// 
        /// \return 布尔操作类型
        virtual gcmp::BooleanOperationTypes GetBooleanOperationType() const = 0;

        /// \brief 获取所有基本体
        /// 
        /// \param forms 返回的所有基本体
        virtual void GetAllGeneralForm(std::vector<IFamilyGeneralForm*>& forms) = 0;

        /// \brief 判断当前Form是否为最高层级的Form
        /// 
        /// \return  如果当前Form为最高层级的Form，返回true；否则，返回false
        virtual bool IsTop() const = 0;

        /// \brief 获取左几何体id
        /// 
        /// \return  基本体id
        virtual gcmp::ElementId GetLeftFormId() const = 0;

        /// \brief 获取右几何体id
        /// 
        /// \return  基本体id
        virtual gcmp::ElementId GetRightFormId() const = 0;

    };

}
